home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 26.zip / BS1 part 26 / Aztec C v5.2a disk 4.adf / 204inc_h.lzh / devices / printer.h < prev    next >
C/C++ Source or Header  |  1991-03-14  |  9KB  |  226 lines

  1. #ifndef     DEVICES_PRINTER_H
  2. #define     DEVICES_PRINTER_H
  3. /*
  4. **    $Filename: devices/printer.h $
  5. **    $Release: 2.04 $
  6. **    $Revision: 1.7 $
  7. **    $Date: 90/07/26 $
  8. **
  9. **    printer.device structure definitions
  10. **
  11. **    (C) Copyright 1987,1988,1989,1990 Commodore-Amiga, Inc.
  12. **        All Rights Reserved
  13. */
  14.  
  15. #ifndef  EXEC_TYPES_H
  16. #include "exec/types.h"
  17. #endif
  18.  
  19. #ifndef  EXEC_NODES_H
  20. #include "exec/nodes.h"
  21. #endif
  22.  
  23. #ifndef  EXEC_LISTS_H
  24. #include "exec/lists.h"
  25. #endif
  26.  
  27. #ifndef  EXEC_PORTS_H
  28. #include "exec/ports.h"
  29. #endif
  30.  
  31. #define  PRD_RAWWRITE       (CMD_NONSTD+0)
  32. #define  PRD_PRTCOMMAND    (CMD_NONSTD+1)
  33. #define  PRD_DUMPRPORT       (CMD_NONSTD+2)
  34. #define  PRD_QUERY       (CMD_NONSTD+3)
  35.  
  36. /* printer command definitions */
  37.  
  38. #define aRIS     0  /* ESCc  reset              ISO */
  39. #define aRIN     1  /* ESC#1 initialize          +++ */
  40. #define aIND     2  /* ESCD  lf              ISO */
  41. #define aNEL     3  /* ESCE  return,lf              ISO */
  42. #define aRI     4  /* ESCM  reverse lf          ISO */
  43.  
  44. #define aSGR0     5  /* ESC[0m normal char set          ISO */
  45. #define aSGR3     6  /* ESC[3m italics on          ISO */
  46. #define aSGR23     7  /* ESC[23m italics off          ISO */
  47. #define aSGR4     8  /* ESC[4m underline on          ISO */
  48. #define aSGR24     9  /* ESC[24m underline off          ISO */
  49. #define aSGR1    10  /* ESC[1m boldface on          ISO */
  50. #define aSGR22    11  /* ESC[22m boldface off          ISO */
  51. #define aSFC    12  /* SGR30-39  set foreground color ISO */
  52. #define aSBC    13  /* SGR40-49  set background color ISO */
  53.  
  54. #define aSHORP0 14  /* ESC[0w normal pitch          DEC */
  55. #define aSHORP2 15  /* ESC[2w elite on              DEC */
  56. #define aSHORP1 16  /* ESC[1w elite off          DEC */
  57. #define aSHORP4 17  /* ESC[4w condensed fine on       DEC */
  58. #define aSHORP3 18  /* ESC[3w condensed off          DEC */
  59. #define aSHORP6 19  /* ESC[6w enlarged on          DEC */
  60. #define aSHORP5 20  /* ESC[5w enlarged off          DEC */
  61.  
  62. #define aDEN6    21  /* ESC[6"z shadow print on          DEC (sort of) */
  63. #define aDEN5    22  /* ESC[5"z shadow print off       DEC */
  64. #define aDEN4    23  /* ESC[4"z doublestrike on          DEC */
  65. #define aDEN3    24  /* ESC[3"z doublestrike off       DEC */
  66. #define aDEN2    25  /* ESC[2"z    NLQ on              DEC */
  67. #define aDEN1    26  /* ESC[1"z    NLQ off          DEC */
  68.  
  69. #define aSUS2    27  /* ESC[2v superscript on          +++ */
  70. #define aSUS1    28  /* ESC[1v superscript off          +++ */
  71. #define aSUS4    29  /* ESC[4v subscript on          +++ */
  72. #define aSUS3    30  /* ESC[3v subscript off          +++ */
  73. #define aSUS0    31  /* ESC[0v normalize the line      +++ */
  74. #define aPLU    32  /* ESCL  partial line up          ISO */
  75. #define aPLD    33  /* ESCK  partial line down          ISO */
  76.  
  77. #define aFNT0    34  /* ESC(B US char set    or Typeface  0 (default) */
  78. #define aFNT1    35  /* ESC(R French char set    or Typeface  1 */
  79. #define aFNT2    36  /* ESC(K German char set    or Typeface  2 */
  80. #define aFNT3    37  /* ESC(A UK char set    or Typeface  3 */
  81. #define aFNT4    38  /* ESC(E Danish I char set    or Typeface  4 */
  82. #define aFNT5    39  /* ESC(H Sweden char set    or Typeface  5 */
  83. #define aFNT6    40  /* ESC(Y Italian char set    or Typeface  6 */
  84. #define aFNT7    41  /* ESC(Z Spanish char set    or Typeface  7 */
  85. #define aFNT8    42  /* ESC(J Japanese char set    or Typeface  8 */
  86. #define aFNT9    43  /* ESC(6 Norweign char set    or Typeface  9 */
  87. #define aFNT10    44  /* ESC(C Danish II char set or Typeface 10 */
  88.  
  89. /*
  90.     Suggested typefaces are:
  91.  
  92.      0 - default typeface.
  93.      1 - Line Printer or equiv.
  94.      2 - Pica or equiv.
  95.      3 - Elite or equiv.
  96.      4 - Helvetica or equiv.
  97.      5 - Times Roman or equiv.
  98.      6 - Gothic or equiv.
  99.      7 - Script or equiv.
  100.      8 - Prestige or equiv.
  101.      9 - Caslon or equiv.
  102.     10 - Orator or equiv.
  103. */
  104.  
  105. #define aPROP2    45  /* ESC[2p  proportional on          +++ */
  106. #define aPROP1    46  /* ESC[1p  proportional off       +++ */
  107. #define aPROP0    47  /* ESC[0p  proportional clear     +++ */
  108. #define aTSS    48  /* ESC[n E set proportional offset ISO */
  109. #define aJFY5    49  /* ESC[5 F auto left justify      ISO */
  110. #define aJFY7    50  /* ESC[7 F auto right justify     ISO */
  111. #define aJFY6    51  /* ESC[6 F auto full justify      ISO */
  112. #define aJFY0    52  /* ESC[0 F auto justify off       ISO */
  113. #define aJFY3    53  /* ESC[3 F letter space (justify) ISO (special) */
  114. #define aJFY1    54  /* ESC[1 F word fill(auto center) ISO (special) */
  115.  
  116. #define aVERP0    55  /* ESC[0z  1/8" line spacing      +++ */
  117. #define aVERP1    56  /* ESC[1z  1/6" line spacing      +++ */
  118. #define aSLPP    57  /* ESC[nt  set form length n      DEC */
  119. #define aPERF    58  /* ESC[nq  perf skip n (n>0)      +++ */
  120. #define aPERF0    59  /* ESC[0q  perf skip off          +++ */
  121.  
  122. #define aLMS    60  /* ESC#9   Left margin set          +++ */
  123. #define aRMS    61  /* ESC#0   Right margin set       +++ */
  124. #define aTMS    62  /* ESC#8   Top margin set          +++ */
  125. #define aBMS    63  /* ESC#2   Bottom marg set          +++ */
  126. #define aSTBM    64  /* ESC[Pn1;Pn2r  T&B margins      DEC */
  127. #define aSLRM    65  /* ESC[Pn1;Pn2s  L&R margin       DEC */
  128. #define aCAM    66  /* ESC#3   Clear margins          +++ */
  129.  
  130. #define aHTS    67  /* ESCH    Set horiz tab          ISO */
  131. #define aVTS    68  /* ESCJ    Set vertical tabs      ISO */
  132. #define aTBC0    69  /* ESC[0g  Clr horiz tab          ISO */
  133. #define aTBC3    70  /* ESC[3g  Clear all h tab          ISO */
  134. #define aTBC1    71  /* ESC[1g  Clr vertical tabs      ISO */
  135. #define aTBC4    72  /* ESC[4g  Clr all v tabs          ISO */
  136. #define aTBCALL 73  /* ESC#4   Clr all h & v tabs     +++ */
  137. #define aTBSALL 74  /* ESC#5   Set default tabs       +++ */
  138. #define aEXTEND 75  /* ESC[Pn"x extended commands     +++ */
  139.  
  140. #define aRAW    76    /* ESC[Pn"r    Next 'Pn' chars are raw +++ */
  141.  
  142. struct IOPrtCmdReq {
  143.     struct  Message io_Message;
  144.     struct  Device  *io_Device;     /* device node pointer  */
  145.     struct  Unit    *io_Unit;        /* unit (driver private)*/
  146.     UWORD   io_Command;        /* device command */
  147.     UBYTE   io_Flags;
  148.     BYTE    io_Error;            /* error or warning num */
  149.     UWORD   io_PrtCommand;        /* printer command */
  150.     UBYTE   io_Parm0;            /* first command parameter */
  151.     UBYTE   io_Parm1;            /* second command parameter */
  152.     UBYTE   io_Parm2;            /* third command parameter */
  153.     UBYTE   io_Parm3;            /* fourth command parameter */
  154. };
  155.  
  156. struct IODRPReq {
  157.     struct  Message io_Message;
  158.     struct  Device  *io_Device;     /* device node pointer  */
  159.     struct  Unit    *io_Unit;        /* unit (driver private)*/
  160.     UWORD   io_Command;        /* device command */
  161.     UBYTE   io_Flags;
  162.     BYTE    io_Error;            /* error or warning num */
  163.     struct  RastPort *io_RastPort;  /* raster port */
  164.     struct  ColorMap *io_ColorMap;  /* color map */
  165.     ULONG   io_Modes;            /* graphics viewport modes */
  166.     UWORD   io_SrcX;            /* source x origin */
  167.     UWORD   io_SrcY;            /* source y origin */
  168.     UWORD   io_SrcWidth;        /* source x width */
  169.     UWORD   io_SrcHeight;        /* source x height */
  170.     LONG    io_DestCols;        /* destination x width */
  171.     LONG    io_DestRows;        /* destination y height */
  172.     UWORD   io_Special;        /* option flags */
  173. };
  174.  
  175. #define SPECIAL_MILCOLS        0x0001    /* DestCols specified in 1/1000" */
  176. #define SPECIAL_MILROWS        0x0002    /* DestRows specified in 1/1000" */
  177. #define SPECIAL_FULLCOLS    0x0004    /* make DestCols maximum possible */
  178. #define SPECIAL_FULLROWS    0x0008    /* make DestRows maximum possible */
  179. #define SPECIAL_FRACCOLS    0x0010    /* DestCols is fraction of FULLCOLS */
  180. #define SPECIAL_FRACROWS    0x0020    /* DestRows is fraction of FULLROWS */
  181. #define SPECIAL_CENTER        0x0040    /* center image on paper */
  182. #define SPECIAL_ASPECT        0x0080    /* ensure correct aspect ratio */
  183. #define SPECIAL_DENSITY1    0x0100    /* lowest resolution (dpi) */
  184. #define SPECIAL_DENSITY2    0x0200    /* next res */
  185. #define SPECIAL_DENSITY3    0x0300    /* next res */
  186. #define SPECIAL_DENSITY4    0x0400    /* next res */
  187. #define SPECIAL_DENSITY5    0x0500    /* next res */
  188. #define SPECIAL_DENSITY6    0x0600    /* next res */
  189. #define SPECIAL_DENSITY7    0x0700    /* highest res */
  190. #define SPECIAL_NOFORMFEED    0x0800    /* don't eject paper on gfx prints */
  191. #define SPECIAL_TRUSTME        0x1000    /* don't reset on gfx prints */
  192. /*
  193.     Compute print size, set 'io_DestCols' and 'io_DestRows' in the calling
  194.     program's 'IODRPReq' structure and exit, DON'T PRINT.  This allows the
  195.     calling program to see what the final print size would be in printer
  196.     pixels.  Note that it modifies the 'io_DestCols' and 'io_DestRows'
  197.     fields of your 'IODRPReq' structure.  Also, set the print density and
  198.     update the 'MaxXDots', 'MaxYDots', 'XDotsInch', and 'YDotsInch' fields
  199.     of the 'PrinterExtendedData' structure.
  200. */
  201. #define SPECIAL_NOPRINT        0x2000    /* see above */
  202.  
  203. #define PDERR_NOERR        0    /* clean exit, no errors */
  204. #define PDERR_CANCEL        1    /* user cancelled print */
  205. #define PDERR_NOTGRAPHICS    2    /* printer cannot output graphics */
  206. #define PDERR_INVERTHAM        3    /* OBSOLETE */
  207. #define PDERR_BADDIMENSION    4    /* print dimensions illegal */
  208. #define PDERR_DIMENSIONOVFLOW    5    /* OBSOLETE */
  209. #define PDERR_INTERNALMEMORY    6    /* no memory for internal variables */
  210. #define PDERR_BUFFERMEMORY    7    /* no memory for print buffer */
  211. /*
  212.     Note : this is an internal error that can be returned from the render
  213.     function to the printer device.  It is NEVER returned to the user.
  214.     If the printer device sees this error it converts it 'PDERR_NOERR'
  215.     and exits gracefully.  Refer to the document on
  216.     'How to Write a Graphics Printer Driver' for more info.
  217. */
  218. #define PDERR_TOOKCONTROL    8    /* Took control in case 0 of render */
  219.  
  220. /* internal use */
  221. #define SPECIAL_DENSITYMASK    0x0700    /* masks out density values */
  222. #define SPECIAL_DIMENSIONSMASK \
  223.     (SPECIAL_MILCOLS|SPECIAL_MILROWS|SPECIAL_FULLCOLS|SPECIAL_FULLROWS\
  224.     |SPECIAL_FRACCOLS|SPECIAL_FRACROWS|SPECIAL_ASPECT)
  225. #endif
  226.